﻿@model CatalogPagingFilteringModel.SpecificationFilterModel
@using Nop.Web.Models.Catalog;
@{
    var renderedAttributeNames = new List<string>();
}
@if (Model.Enabled)
{
    <div class="product-spec-filter">
        <div class="title">
            @T("Filtering.SpecificationFilter")
        </div>
        <div class="clear">
        </div>
        @if (Model.NotFilteredItems.Count > 0)
        {
            <div class="available-items">
                @foreach (var item in Model.NotFilteredItems)
                {
                    if (!renderedAttributeNames.Contains(item.SpecificationAttributeName))
                    {
                        renderedAttributeNames.Add(item.SpecificationAttributeName);
                    <div class="group">
                        @item.SpecificationAttributeName
                    </div>
                    }
                    <div class="item">
                        <a href="@item.FilterUrl">@item.SpecificationAttributeOptionName</a>
                    </div>
                }
            </div>
        }
        @if (Model.AlreadyFilteredItems.Count > 0)
        {
            <div class="already-filtered-items">
                <div class="title">
                    @T("Filtering.SpecificationFilter.CurrentlyFilteredBy")
                </div>
                @foreach (var item in Model.AlreadyFilteredItems)
                {
                    <div class="item">
                        <strong>@(item.SpecificationAttributeName):</strong> @item.SpecificationAttributeOptionName
                    </div>
                }
            </div>
            <div class="remove-filter">
                <a href="@Model.RemoveFilterUrl">@T("Filtering.SpecificationFilter.Remove")</a>
            </div>
        }
    </div>
}